<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位-绝对定位</title>
</head>

<style>
   * {
      padding: 0;
      margin: 0; 
   }

   .box {
       /* position: static;   static即没有定位 */
       position: relative; /* 父需要有定位，子的绝对定位才有意义 */
       width: 1226px;
       height: 615px;
       background-color: skyblue;
       margin: 10px auto; 
       /* padding-top: 15px ; */
   }

   .sub { 
       position: absolute;   /* 若父没有 */
       right: 0;

       height: 200px;
       width: 200px;
       background-color: pink;
   }


</style>
<body>
    <div class="box">
        <div class="sub">01</div>
    </div>
</body>
</html>